package com.njbw.pojo.dependOn;

import org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 长沙先飞信息科技有限公司<br>
 * Created with IntelliJ IDEA.<br>
 * Date:2025/7/28<br>
 * Time:10:36<br>
 * 功能描述：<br>
 *
 * @author huang hou chun
 * @since JDK 1.8 <br>
 * Copyright (c) 2023 www.csxfrj.com System Incorporated All Rights Reserved.
 */
public class DependsOnApplication {

    private static final String LOCATION = "spring/depends_on.xml";

    public static void main(String[] args) {
        // testDependsOnReader();
        testDependsOn();
    }

    private static void testDependsOn() {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(LOCATION);
        System.out.println(context.getBeanDefinitionCount());
        context.close();
    }

    private static void testDependsOnReader() {
        SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(registry);
        reader.loadBeanDefinitions(LOCATION);
        System.out.println(registry.getBeanDefinitionCount());
    }
}
